<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<div class="container">
	
	<div class="clearfix">
		&nbsp;
	</div>
	
	<div class="span12">
	
		<form id="contentForm" class="form-horizontal" method="POST">
		
			<fieldset>
	    		<legend>
	    			<div class="row-fluid">
					  <div class="span8">컨텐츠 등록</div>
					  <div class="span4" align="right">
					  	<button id="btn-content-create-action" class="btn btn-small btn-inverse" type="button">등록</button>
				  		<button class="btn btn-small btn-danger btn-url" type="button" data-url="javascript:history.back();"">취소</button>
					  </div>
					</div>
	    		</legend>
			
				
				
				<div class="control-group">
					<label class="control-label" for="contents_nm">컨텐츠명</label>
					<div class="controls">
						<input type="text" class="input-xxlarge" id="contents_nm" name="contents_nm" placeholder="컨텐츠명" value="" required="required" data-validation-required-message="콘텐츠명을 입력해 주세요.">
					</div>
				</div>		
				<div class="control-group">
					<label class="control-label" for="contents_txt">이야기 입력</label>
					<div class="controls">
						<textarea rows="20" class="input-xxlarge" id="contents_txt" name="contents_txt" placeholder="이야기 입력" required="required" data-validation-required-message="이야기를 입력해 주세요."></textarea>
					</div>
				</div>	
			</fieldset>
		  
		</form>
	</div>

</div>

<script>
$(function(){
	
	//유효성 체크
	$("input,select,textarea").not("[type=submit]").jqBootstrapValidation();
	
	$("#btn-content-create-action").click(function(){
		bootbox.confirm( "등록 하시겠습니까?", function(result) {
			if( result ) {
				$( "#contentForm" )
					.attr("action", '/ouat_admin/contents/createAction.do')
					.submit();
			}
		}); 
	});
});
</script>